/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#include "ListBox.h"
#include "../ListBox.h"

namespace liba
{
namespace lib2d
{
namespace gui
{
namespace view
{

ListBox::ListBox( gui::ListBox * obj )
:	Object( obj ),
	obj( obj )
{}

ListBox::~ListBox()
{}

void ListBox::render( hard::Renderer * rend )
{
	Rect rect = obj->get_window_rect();
	rect.x = 0;
	rect.y = 0;
	rend->fill( rect, ColorPacked( 30, 230, 30 ) );
	rend->push_clip_rect( rect );
	rend->push_shift_add( Vector2( 0, -obj->get_position() ) );
	obj->get_container()->get_view()->render( rend );
	rend->pop_shift();
	rend->pop_clip_rect();

	Object::render( rend );
}

} //namespace view
} //namespace gui
} //namespace lib2d
} //namespace liba

